package com.gopay.common.cps.dao.wallet.creditCard.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.wallet.creditCard.CardRepaymentDao;
import com.gopay.common.domain.dps.CardRepayment;
import com.gopay.common.exception.GopayException;
/**
 * 
 * @author dps
 *
 */
@Repository("commonCardRepaymentDao")
public class CardRepaymentDaoImpl extends BaseDAOImpl<CardRepayment, Integer> implements CardRepaymentDao {

	/**
	 * 根据还款提醒日和是否开通还款提醒= 1 开启，查询数据
	 */
	@Override
	public List<CardRepayment> queryByRepaymenDayAndRepayme (Long repaymenDay ,Long repayme) throws GopayException {
		String hql="from CardRepayment where repaymenDay=:repaymenDay and repayme=:repayme and isdel=:isdel";
		Map<String,Object> paramMap=new HashMap<String,Object>();
		paramMap.put("repaymenDay", repaymenDay);
		paramMap.put("repayme", repayme);
		paramMap.put("isdel", 0);
		List<CardRepayment> cardRepaymentList = this.findByHql(hql,paramMap);
		if(cardRepaymentList==null || cardRepaymentList.size()==0){
			return new ArrayList<CardRepayment>();
		}
		return cardRepaymentList;
	}
}
